# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Brett Cornwall <ainola@archlinux.org>
# Contributor: Zerial <fernando@zerial.org>
# Contributor: Patrick Leslie Polzer <leslie.polzer@gmx.net>
# Contributor: Jose Riha <jose1711 gmail com>

pkgname=dd_rescue
pkgver=1.99.13
pkgrel=1
pkgdesc="A dd version that is very useful for data-recovery"
url="http://www.garloff.de/kurt/linux/ddrescue/"
license=("GPL")
depends=('openssl')
optdepends=('lzo: for libddr_lzo')
arch=('loong64' 'x86_64')
source=("http://www.garloff.de/kurt/linux/ddrescue/$pkgname-${pkgver}.tar.bz2"{,.asc})
sha512sums=('2276128fe176dce3ecbd6aa8e0d00b9547887f0498ce0cd135e61dbf882c521e22e2afce3539a73496da1d0472cd9582971a30eb558ce3211820c8d0358c8241'
            'SKIP')
validpgpkeys=('6669F7340D31E95EC5565490DE4F1B3A2BFFC5BF') # Kurt Garloff <kurt@garloff.de>

prepare() {
  cd $pkgname-$pkgver
  autoreconf -fi

  # Don't install to /usr/lib64
  sed -i '/LIB = lib64/d' Makefile
}

build() {
  cd $pkgname-$pkgver
  ./configure
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" INSTALLDIR="$pkgdir/usr/bin" install
}
